import React, { Component } from 'react'
import PropTypes from 'prop-types'
export default class App extends Component {
  data={name:"jack"}
  render() {
    return (
      <div>
        <Child {...this.data}/>
      </div>
    )
  }
}
function Child(props){
  return <>
    <ul>
      <li>姓名：{props.name}</li>
      <li>年龄：{props.age}</li>
      <li>性别：{props.sex}</li>
    </ul>
  </>
}
Child.prototype={
  name:PropTypes.string.isRequired
}
Child.defaultProps={
  sex:"nan",
  age:100
}
